/* api */
import { taskTypeByTag } from '@src/api/ReportApi'
/* hooks */
import { useFetchResult } from "@hooks/useFetch"
/* model */
import { ChartTaskType } from "@model/param/out/Chart"
/* vue */
import { computed, ComputedRef } from "vue"

/** 
 * @description 获取图表工单类型数据
*/
export async function useChartTaskTypeFetch(): Promise<ComputedRef<ChartTaskType>> {
  
  let [data, callback] = useFetchResult<{}, ChartTaskType[]>(async () => {
    return taskTypeByTag()
  }, {})
  
  await callback()
  
  return computed(() => data.value || {})
}